package org.fglxy.mockserver.enums;

import com.fasterxml.jackson.annotation.JsonValue;

public enum RetCodeEnum {
	SUCCESS(0, "成功"),
	INVALID_PARAM(10003, "参数校验失败"),
	NO_MOCK(20001, "不存在的mock计划"),
	START_MOCK_FAIL(20002, "mock启动失败"),
	WRITE_MOCK_BASE_CONFIG_FAIL(20003, "写入mock基础配置文件失败"),
	WRITE_MOCK_DESCRIPT_FAIL(20004, "写入mock协议描述文件"),
	WRITE_MOCK_TASK_FAIL(20005, "写入mock触发任务失败"),
	WRITE_MOCK_CMDNOS_FAIL(20006, "写入协议映射文件失败"),
    ERROR(99999,"未知错误");
    
    private Integer code;
    private String desc;
    
    private RetCodeEnum(Integer code , String desc){
        this.code = code;
        this.desc = desc;
    }

    @Override
    public String toString() {
        return String.valueOf(this.code);
    }
    
    @JsonValue
    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
